﻿using System;
using DevExpress.XtraEditors.DXErrorProvider;
namespace MMS
{
    public class OrderFormDTO : IDXDataErrorInfo
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the OrderFormDTO class.
		/// </summary>
		public OrderFormDTO()
		{
		}

		/// <summary>
		/// Initializes a new instance of the OrderFormDTO class.
		/// </summary>
		public OrderFormDTO(string id, string idCustomer, int vat, int discount, string building)
		{
			this.Id = id;
			this.IdCustomer = idCustomer;
			this.Vat = vat;
			this.Discount = discount;
			this.Building = building;
		}

		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the Id value.
		/// </summary>
		public string Id { get; set; }

		/// <summary>
		/// Gets or sets the IdCustomer value.
		/// </summary>
		public string IdCustomer { get; set; }

		/// <summary>
		/// Gets or sets the Vat value.
		/// </summary>
		public int Vat { get; set; }

		/// <summary>
		/// Gets or sets the Discount value.
		/// </summary>
		public int Discount { get; set; }

		/// <summary>
		/// Gets or sets the Building value.
		/// </summary>
		public string Building { get; set; }
        public void GetPropertyError(System.String propertyName, DevExpress.XtraEditors.DXErrorProvider.ErrorInfo info)
        {
            if (propertyName == "Building" && Building == "")
            {
                //string strConvention = "Tên đơn vị";
                //info.ErrorText = String.Format("{0} không được rỗng", strConvention);
                info.ErrorText = MessageBundle.ERROR_EMPTY_FIELD.Value;

            }

        }
        public void GetError(DevExpress.XtraEditors.DXErrorProvider.ErrorInfo info)
        {

        }
		#endregion
	}
}
